<template>
	<view class="block">
		<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
			<image class="avatar" :src="avatarUrl"></image>
		</button>
		<input type="nickname" class="weui-input" placeholder="请输入昵称" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				avatarUrl: ''
			}
		},
		onLoad() {
			console.log(this.$store.state);
			this.avatarUrl = this.$store.state.userInfo.avatar
		},
		methods: {
			onChooseAvatar(e) {
				console.log(e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.block {}
</style>
